Stream Object Result
A typed streaming-object result — the v6 StreamObjectResult surface. Wraps the underlying StreamEvent flow so callers get the object as it builds and the final typed value, without hand-parsing the stream.
The streams are cold: collecting one drives a model call, so pick a single consumer (partialObjectStream for incremental UI, or objectValue() for just the final result).
Properties
The object as it builds: each emission is the best-effort decode of the text so far (incomplete JSON is repaired via parsePartialJson); the final emission is the complete object. Duplicate parses are suppressed.
The raw text deltas as they arrive (cold — collecting drives a model call).
Functions
For an array output (built via Output.array), emit each element as soon as it is complete (all elements but the in-flight last, then the last when the stream ends) — the v6 elementStream. Pass the same array output you streamed.
Collect to completion and return the final typed object plus the call's terminal metadata (usage, finishReason, warnings, response) — the awaitable side of the v6 StreamObjectResult. The complete text is decoded once at the end; if that fails and a repairText hook is set, the repaired text is retried. Throws NoObjectGeneratedError (carrying the raw text) if neither parses.
Collect to completion and return just the final typed object (see finish for the call's usage / finishReason / warnings / response).